package com.xyazm.order.controller;


import com.xyazm.common.page.PagingInfo;
import com.xyazm.order.domain.dto.AfterSaleOrderDetailDTO;
import com.xyazm.order.domain.dto.AfterSaleOrderListDTO;
import com.xyazm.order.domain.param.QueryAfterSaleParam;
import com.xyazm.order.service.IAfterSaleQueryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 售后单查询
 * </p>
 */
@RestController
@RequestMapping("/afterSale/query")
public class AfterSaleQueryController {


    @Autowired
    private IAfterSaleQueryService afterSaleQueryService;

    /**
     * 查询售后列表
     * @author xuyou
     * @date: 2022/7/21 16:03
     */
    @PostMapping("/listAfterSales")
    public PagingInfo<AfterSaleOrderListDTO> listAfterSales(@RequestBody QueryAfterSaleParam param) {
        PagingInfo<AfterSaleOrderListDTO> result = afterSaleQueryService.listAfterSales(param);
        return result;
    }

    /**
     * 查询售后单详情
     * @author xuyou
     * @date: 2022/7/21 16:07
     * @param: afterSaleId 售后单id
     */
    @GetMapping("/afterSaleDetail")
    public AfterSaleOrderDetailDTO afterSaleDetail(String afterSaleId) {
        return afterSaleQueryService.afterSaleDetail(afterSaleId);
    }



}
